package cn.sunjinxin.trade.application.event;

import cn.sunjinxin.savior.event.context.EventContext;
import cn.sunjinxin.savior.event.listener.sub.AsyncListener;
import cn.sunjinxin.trade.domain.even.TradeEvent;
import cn.sunjinxin.trade.domain.model.Order;
import com.google.common.collect.Lists;

import java.util.List;

/**
 * @author issavior
 */
public class PayOrderListener implements AsyncListener<TradeEvent, Order> {

    @Override
    public List<TradeEvent> supportEventType() {
        return Lists.newArrayList(TradeEvent.PAY);
    }

    @Override
    public void handle(EventContext<TradeEvent, Order> tradeEventOrderEventContext) {
        Order order = tradeEventOrderEventContext.getRequest();
//
//        Toc toc = Toc.init(order, TocType.CREATE_ORDER_TIME_OUT);
//        toc.register();
    }

}
